gralde 循环依赖的问题

今天遇到一个问题,添加一个EventBus依赖包之后运行一直报:‘java.exe finished with non-zero exit value 2 ’

在statckoverflow上找到了问题的答案:

First of all you should try to list your dependencies with gradle :MODULE:dependencies Check if there are libraries conflicts ( same library but different version ). In this case i supose you should exclude support library module from Facebook SDK.

compile ('com.facebook.android:facebook-android-sdk:3.23.1'){    
    exclude group: 'com.google.android', module: 'support-v4'    
}

解决方法

在添加EventBus的依赖的地方添加如下代码:

compile ('de.greenrobot:eventbus:2.0.1'){
    exclude group: 'com.google.android', module: 'support-v4'
    exclude group: 'com.google.android', module: 'annotations'
    exclude group: 'com.google.android', module: 'android-test'
}

本站总访问量次,本站访客数人次,本文总阅读量